package com.canton.service.impl;

import com.canton.dao.entity.GrapeNode;
import com.canton.dao.entity.ImageNode;
import com.canton.dao.repository.GrapeRepository;
import com.canton.dao.repository.ImageRepository;
import com.canton.service.GrapeService;
import com.canton.service.ImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;

@Service
public class ImageServiceImpl implements ImageService {
    @Autowired
    private ImageRepository imageRepository;
//    @Autowired
//    private GrapeService grapeService;

    @Override
    public ImageNode findByName(String name) {
        return imageRepository.findByName(name);
    }

    @Override
    public List<ImageNode> findAll() {
        return imageRepository.findAll();
    }

    @Override
    public List<ImageNode> findByNameLike(String likes) {
        return imageRepository.findByNameLike(likes);
    }

    @Override
    public Collection<ImageNode> findAllLimitBy(String name, int limit) {
        return imageRepository.findAllLimitBy(name,limit);
    }

}
